Namespace CardGameFramework

    ''' <summary>
    ''' Card suit values
    ''' </summary>
    Public Enum Suit
        Diamonds = 1
        Spades = 20
        Clubs = 70
        Hearts = 50
        Trumps = 100
        Fool = 99
    End Enum

    ''' <summary>
    ''' Card face values
    ''' </summary>
    Public Enum FaceValue
        Fool = 0
        Ace = 1
        Two = 2
        Three = 3
        Four = 4
        Five = 5
        Six = 6
        Seven = 7
        Eight = 8
        Nine = 9
        Ten = 10
        Jack = 11
        Knight = 12
        Queen = 13
        King = 14
        Eleven = 1100
        Twelve = 1200
        Thirteen = 1300
        Fourteen = 1400
        Fifteen = 1500
        Sixteen = 1600
        Seventeen = 1700
        Eighteen = 1800
        Nineteen = 1900
        Twenty = 2000
        TwentyOne = 2100
    End Enum

    Public Class Card
        ' Objects for card information
        Private _suitProp As Suit
        Private _faceValProp As FaceValue
        Private _playValueProp As Integer
        Private _isCardUpProp As Boolean

        Public Property Suit() As Suit
            Get
                Return _suitProp
            End Get
            Set(ByVal value As Suit)
                _suitProp = value
            End Set
        End Property

        Public Property FaceVal() As FaceValue
            Get
                Return _faceValProp
            End Get
            Set(ByVal value As FaceValue)
                _faceValProp = value
            End Set
        End Property
        Public Property PlayValue() As Integer
            Get
                Return _playValueProp
            End Get
            Set(ByVal value As Integer)
                _playValueProp = value
            End Set
        End Property

        Public Property IsCardUp() As Boolean
            Get
                Return _isCardUpProp
            End Get
            Set(ByVal value As Boolean)
                _isCardUpProp = value
            End Set
        End Property

        ''' <summary>
        ''' Constructor for a new card. 
        ''' </summary>
        ''' <param name="suitProp"></param>
        ''' <param name="faceValProp"></param>
        ''' <param name="isCardUpProp"></param>
        ''' <remarks>Assign the card a suit, face value, and if the card is facing up or down</remarks>
        Public Sub New(ByVal suitProp As Suit, ByVal faceValProp As FaceValue, ByVal playValueProp As Integer, ByVal isCardUpProp As Boolean)
            Me._suitProp = suitProp
            Me._faceValProp = faceValProp
            Me._playValueProp = playValueProp
            Me._isCardUpProp = isCardUpProp
            'If Me._suitProp <> Suit.Trumps Then
            '    Select Case faceValProp
            '        Case Is = FaceValue.Eleven
            '            Me._faceValProp = FaceValue.Jack
            '            Me._playValueProp = 11
            '        Case Is = FaceValue.Twelve
            '            Me._faceValProp = FaceValue.Knight
            '            Me._playValueProp = 12
            '        Case Is = FaceValue.Thirteen
            '            Me._faceValProp = FaceValue.Queen
            '            Me._playValueProp = 13
            '        Case Is = FaceValue.Fourteen
            '            Me._faceValProp = FaceValue.King
            '            Me._playValueProp = 14
            '    End Select
            'End If
        End Sub

        ''' <summary>
        ''' Return the card as a string (i.e. "Ace of Spades")
        ''' </summary>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Overloads Overrides Function ToString() As String
            Dim result As String = ""
            If _faceValProp = 0 Then
                result = "Fool"
                Return result
            End If
            If _suitProp = Suit.Trumps Then
                Select Case _faceValProp
                    Case Is < 11, Is > 14
                        result = _faceValProp.ToString & " of " & _suitProp.ToString
                    Case Is = 11
                        result = "Eleven of Trumps"
                    Case Is = 12
                        result = "Twelve of Trumps"
                    Case Is = 13
                        result = "Thirteen of Trumps"
                    Case Is = 14
                        result = "Fourteen of Trumps"
                End Select
            Else
                Select Case _faceValProp
                    Case Is < 11
                        result = _faceValProp.ToString & " of " & _suitProp.ToString
                    Case Is = 11
                        result = "Jack of " & _suitProp.ToString
                    Case Is = 12
                        result = "Knight of " & _suitProp.ToString
                    Case Is = 13
                        result = "Queen of " & _suitProp.ToString
                    Case Is = 14
                        result = "King of " & _suitProp.ToString
                End Select
            End If
            Return result
        End Function
       
    End Class
End Namespace